package javaStu.MyCompare;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;

/**
 * @author: leiwenkang
 * @date: 2020/7/14
 * @time: 19:53
 */
public class Test {
    public static void main(String[] args) {
        List<Student> list = new ArrayList<>();

        Student student1 = new Student(2);
        Student student2 = new Student(1);

        list.add(student1);
        list.add(student2);

        System.out.println(list);
//        Collections.sort(list);
        Collections.sort(list, new Comparator<Student>() {
            @Override
            public int compare(Student o1, Student o2) {
                return 0;
            }
        });
        System.out.println(list);
    }
}
